<html>
    <head>
        <meta charset="utf-8">
        <meta name="author" content="吴胭脂">
        <title>校园二手信息交易网</title>
        <link rel="stylesheet" href="lib/bootstrap/css/bootstrap.css">
        <link rel="stylesheet" href="css/fabu.css">
    </head>
    <style>
        .navbar-inverse{
            width: 1000px;
            margin: 20px auto;
        }
        .container{
            width: 1000px;
            background-color: wheat;
        }
    </style>
    <body>
        <nav class="navbar navbar-inverse">
            <span class="navbar-brand">信息的发布</span>
            
            <div class="dropdown navbar-brand pull-right">
                <span  id="login">
                    <i class="glyphicon glyphicon-user "></i>
                    <span>登录</span>
                </span>
                <ul class="dropdown-menu" aria-labelledby="login">
                    <li><a href="./user.html">个人资料</a></li>
                    <li role="separator" class="divider"></li>
                    <li><a onclick="logout();">退出</a></li>
                </ul>
            </div>
            
            <span  onclick="gotoAsk();" class=" navbar-brand pull-right">
                <i class="glyphicon glyphicon-plus"></i>
                提问
            </span>
        </nav>

        <main class="container"></main>

        <script id="questions" type="text/html">
            {{each message item}}
                <div class="cell" onclick="goToAnswer(event);"  data-time="{{item.time}}">
                    <img  src="upload/{{item.petname}}.jpg" alt="用户头像">
                    <div>
                        <h3>{{item.petname}}</h3>
                        <p>{{item.ask}}</p>
                        <time>{{item.date | formatDate}}</time>
                    </div>
                </div>
                {{each item.answers answer}}
                    <div class="answer">
                        <img src="upload/{{answer.petname}}.jpg" alt="用户图片">
                        <div>
                            <h3>{{answer.petname}}</h3>
                            <p>{{answer.answer}}</p>
                            <time>{{answer.date | formatDate}}</time>
                        </div>
                    </div>
                {{/each}}
            {{/each}}
            
        </script>
        <script src="lib/bootstrap/js/jquery.js"></script>
        <script src="lib/jquery.cookie.js"></script>
        <script src="lib/bootstrap/js/bootstrap.js"></script>
        <script src="lib/template-web.js"></script>
        <script src="js/fabu.js"></script>
    </body>
</html>